#include<iostream>
using namespace std;
class Grand
{
private:
	int a;
public:
	Grand(int i):a(i)
	{
		cout << "constructing Grand" << endl;
	}
	~Grand()
	{
		cout << "destructing Grand" << endl;
	}
};
class Father:public Grand
{
private:
	int b;
public:
	Father(int n1, int n2) :Grand(n1), b(n2)
	{
		cout << "constructing Father" << endl;
	}
	~Father()
	{
		cout << "destructing Father" << endl;
	}
};
class Mother
{
private:
	int c;
public:
	Mother(int n1):c(n1)
	{
		cout << "constructing Mother" << endl;
	}
	~Mother()
	{
		cout << "destructing Mother" << endl;
	}
};
class Son :public Father, public Mother
{
private:
	int d;
public:
	Son(int n1, int n2, int n3, int n4) :Mother(n2),Father(n3,n4),d(n1)
	{
		cout << "constructing Son\n";
	}
};
int main(void)
{
	Son obj(1, 2, 3, 4);
	return 0;
}